#pragma once

#include "controlcenter_global.h"
#include <osg/ref_ptr>
#include "MainManipulator.h"
#include "transformableactor.h"

namespace osg
{
	class Camera;
}

namespace ControlCenter
{
	class CONTROLCENTER_EXPORT TerrainBrushManipulator: public MainManipulator
	{
	public:
		TerrainBrushManipulator(osg::Camera* maincamera);
		void setMainCamera(osg::Camera* camera)
		{
			_mainCamera = camera;
		}
		virtual void mouseClick(const osgGA::GUIEventAdapter* ea0,const osgGA::GUIEventAdapter* ea1,
			const osgGA::GUIEventAdapter* key0,const osgGA::GUIEventAdapter* key1);
		virtual void mouseRelease(const osgGA::GUIEventAdapter* ea0,const osgGA::GUIEventAdapter* ea1,
			const osgGA::GUIEventAdapter* key0,const osgGA::GUIEventAdapter* key1);
		virtual void mouseMove(const osgGA::GUIEventAdapter* ea0,const osgGA::GUIEventAdapter* ea1);
		void computePositionByScreenPoint(osg::Vec3& eye,osg::Vec3& center,osg::Vec3& up);
		virtual void mouseDoubleClick(const osgGA::GUIEventAdapter* ea0,const osgGA::GUIEventAdapter* ea1,
			const osgGA::GUIEventAdapter* key0,const osgGA::GUIEventAdapter* key1){}
	protected:
		virtual ~TerrainBrushManipulator();
		void testBrush();
	private:
		VrDataCore::TransformableActor*				_terrainActor;
		osg::Camera*								_mainCamera;
		osg::Vec3									_mouseCurrentpos;
	};
}